Skip to main content
GET
/
api
/
pedidos
/
estado
/
{estado}
Get Orders by Status
curl --request GET \
  --url https://api.example.com/api/pedidos/estado/{estado}
Retrieves all orders filtered by their status (estado).

Authentication

Requires JWT token in the Authorization header.
Authorization: Bearer YOUR_JWT_TOKEN

Path Parameters

ParameterTypeRequiredDescription
estadoStringYesOrder status to filter by (see EstadoPedido values)

Valid Estado Values

  • PENDIENTE - Pending orders
  • PAGADO - Paid orders
  • ENVIADO - Shipped orders
  • ENTREGADO - Delivered orders
  • CANCELADO - Cancelled orders

Response

Returns an array of orders matching the specified status.

Response Body

[
  {
    "pedido_id": 42,
    "referencia": "ORD-2026-042",
    "usuario": {
      "usuario_id": 5,
      "username": "john_doe",
      "email": {
        "address": "john@example.com"
      }
    },
    "fechaPedido": "2026-03-11T14:22:35",
    "estado": "ENVIADO",
    "detalles": [
      {
        "detalle_id": 101,
        "producto": {
          "producto_id": 10,
          "nombre": "BILLY Bookcase",
          "precioCantidad": 49.99,
          "precioMoneda": "USD",
          "es_destacado": false
        },
        "cantidad": 2,
        "precioUnitario": 49.99,
        "subtotal": 99.98
      }
    ],
    "total": 99.98
  },
  {
    "pedido_id": 43,
    "referencia": "ORD-2026-043",
    "usuario": {
      "usuario_id": 8,
      "username": "jane_smith",
      "email": {
        "address": "jane@example.com"
      }
    },
    "fechaPedido": "2026-03-11T15:10:20",
    "estado": "ENVIADO",
    "detalles": [
      {
        "detalle_id": 103,
        "producto": {
          "producto_id": 15,
          "nombre": "MALM Dresser",
          "precioCantidad": 129.99,
          "precioMoneda": "USD",
          "es_destacado": true
        },
        "cantidad": 1,
        "precioUnitario": 129.99,
        "subtotal": 129.99
      }
    ],
    "total": 129.99
  }
]

Response Fields

FieldTypeDescription
pedido_idLongUnique order identifier
referenciaStringAuto-generated order reference number
usuarioObjectUser who placed the order
usuario.usuario_idLongUser ID
usuario.usernameStringUsername
usuario.email.addressStringUser email address
fechaPedidoDateTimeOrder creation timestamp
estadoStringOrder status (matches the requested estado)
detallesArrayArray of order line items
detalles[].detalle_idLongLine item ID
detalles[].productoObjectProduct details
detalles[].cantidadIntegerQuantity ordered
detalles[].precioUnitarioBigDecimalUnit price at time of order
detalles[].subtotalBigDecimalLine item subtotal
totalBigDecimalTotal order amount

Example Requests

Get all pending orders

curl -X GET "https://api.iquea.com/api/pedidos/estado/PENDIENTE" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"

Get all shipped orders

curl -X GET "https://api.iquea.com/api/pedidos/estado/ENVIADO" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"

Get all delivered orders

curl -X GET "https://api.iquea.com/api/pedidos/estado/ENTREGADO" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"

Status Codes

CodeDescription
200Success - Returns array of orders (may be empty)
400Bad request - Invalid estado value
401Unauthorized - Invalid or missing token
500Internal server error

Use Cases

  • Dashboard views showing orders by status
  • Order fulfillment workflows (pending → paid → shipped → delivered)
  • Customer service queries
  • Analytics and reporting on order statuses